﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace XHCTMS.VIEW
{
    public partial class ClassroomPerformance : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                Session["classid"] = "1304";
                int ClassId = int.Parse(Session["classid"].ToString());
                StudentView.DataSource = new BLL.ClassroomPerformance().GetClassStudent(1304);
                StudentView.DataBind();
            }
        }

        protected void submit_Click(object sender, EventArgs e)
        {
            string Scores = Grade.Text;
            string[] StudentsScores = Scores.Remove(Scores.LastIndexOf(':')).Split(':');
            new BLL.ClassroomPerformance().SetStudentScores(StudentsScores);
            ScriptManager.RegisterStartupScript(this, this.GetType(), "submit", "$('<div>已提交</div>').dialog()", true);
        }
    }
}